import React, { memo } from 'react';
import { renderRoutes } from 'react-router-config';
// provider  是把redux 里的store 把react 给连接起来的
import {Provider} from 'react-redux';
// Provider是作为整个App的容器，在你原有的App Container的基础上再包上一层
// 接受Redux的store作为props，并将其声明为context的属性之一
// 子组件可以在声明了contextTypes之后可以方便的通过this.context.store访问到store

import routes from './router';
import store from './store';
import { HashRouter } from 'react-router-dom';

import YAppHeader from 'components/app-header';
import YAppFooter from 'components/app-footer';
import YAppPlayerBars from './pages/player/app-paly-bar';


export default memo(function App() {
	return (
		<Provider store= {store}>
			<HashRouter>
				<YAppHeader></YAppHeader>
				{renderRoutes(routes)}
				<YAppFooter></YAppFooter>
				<YAppPlayerBars></YAppPlayerBars>
			</HashRouter>
		</Provider>	

	)
})